package com.vanzo.talkie2;

import android.content.Context;
import android.support.annotation.Nullable;
import android.util.AttributeSet;
import android.view.Gravity;
import android.widget.ImageButton;
import android.widget.LinearLayout;
import android.widget.TextView;

/**
 * Created by tisen on 2018/1/18.
 */

public class MeunItemView extends LinearLayout {

    private TextView textView;
    private ImageButton imageButton;

    public MeunItemView(Context context, @Nullable AttributeSet attrs) {
        super(context, attrs);
        textView = new TextView(context, attrs);
        imageButton = new ImageButton(context, attrs);
        textView.setGravity(Gravity.CENTER_HORIZONTAL);
        textView.setPadding(0, 0, 0, 0);
        setClickable(true);
        setFocusable(true);
        setOrientation(VERTICAL);
        addView(imageButton);
        addView(textView);
    }

    public void setText(int resId) {
        textView.setText(resId);
    }

    public void setText(CharSequence charSequence) {
        textView.setText(charSequence);
    }

    public void setTextColor(int color) {
        textView.setTextColor(color);
    }
}
